#!/usr/bin/env node

const me = {},
      stdout = process.stdout,
      stdin = process.stdin,
      log = console.log,
      msg = ['name', 'email', 'qq', 'mobile'];

//let i=0;

//stdout.write(msg[i]+':');
//stdin.on('data', (data)=>{
  //me[msg[i++]] = data.toString('utf8');
  //stdout.write(msg[i]+':');
//});
//stdin.on('end', ()=>{
  //console.log('bye')
//});

let i=1;
stdout.write(msg[0]+':');
//stdin.on('data', (data)=>{
  //var cmd = 'me.'+msg[i-1]+'="'+data.slice(0,data.length-1)+'"';
  //eval(cmd);
  //console.log(msg[i++]+':');
//});

stdin.on('data', (data) => {
   me[msg[i-1]] = data.slice(0,data.length-1).toString('utf8');
   if(i === 4) {
      log(me);
      process.exit();       
   }
   stdout.write(msg[i++] + ': ');
});

stdin.on('end', ()=>{
  log(me);
})

